package com.nbufe.command.demo3;

/**
 * @Author Zan
 * @Create 2024/6/12 14:24
 * @ClassName: Client
 * @Description : TODO 请用一句话描述该类的功能
 */
public class Client {
    public static void main(String[] args) {
        System.out.println("=========加法=========");
        Computer computer = new Computer();
        computer.setCommand(new AdderCommand());
        computer.execute(10);
        computer.revoke();
        computer.resume();

        System.out.println("=========减法=========");
        Computer computer2 = new Computer();
        computer2.setCommand(new SubtractCommand());
        computer2.execute(30);
        computer2.revoke();

        System.out.println("=========乘法=========");
        Computer computer3 = new Computer();
        computer3.setCommand(new MultiplierCommand());
        computer3.execute(20);
        computer3.revoke();
        computer3.resume();

        System.out.println("=========除法=========");
        Computer computer4 = new Computer();
        computer4.setCommand(new DividerCommand());
        computer4.execute(2);
        computer4.revoke();
        computer4.resume();
    }
}
